<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>async函数</title>
</head>

<body>
  <h2>大家好！</h2>
</body>
<script>
  window.onload = function () {
    async function main() {
      // 1. 返回非 Promise 类型数据
      // return 468

      // 2. 返回 Promise 类型的数据
      /* return new Promise((resolve,reject)=>{
        reject('失败！')
      }) */

      // 3. 抛出异常
      // throw '异常！'
    }

    let results = main()
    console.log(results);
  }
</script>

</html>